package com.ssy.lingxi.search.repository;

import com.ssy.lingxi.search.entity.OftenSelect;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 常用筛选持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/9/2
 */
public interface OftenSelectRepository extends JpaRepository<OftenSelect,Long>, JpaSpecificationExecutor<OftenSelect> {
    List<OftenSelect> findByUserIdAndNameAndIdNot(Long userId, String name, Long id);

    List<OftenSelect> findByUserIdAndName(Long userId, String name);

    Page<OftenSelect> findByUserId(Long userId, Pageable page);
}
